﻿using System.IO;
using System.Xml;
using System;

namespace QAToolsAddin {

    class XmlDocumentNoNS : XmlDocument {

        public override void Load(Stream inStream){
            base.Load(new XmlTextReaderNoNS(inStream));
        }

        public override void Load(string filename) {
            base.Load(new XmlTextReaderNoNS(filename));
        }

        public override void Load(TextReader txtReader) {
            base.Load(new XmlTextReaderNoNS(txtReader));
        }

        public override void Load(XmlReader reader) {
            throw new NotImplementedException();
        }

        public override void LoadXml(string xml) {
            base.Load(new XmlTextReaderNoNS(xml));
        }
    }

    class XmlTextReaderNoNS : XmlTextReader {
        public XmlTextReaderNoNS(TextReader input) : base(input) { }
        public XmlTextReaderNoNS(Stream input) : base(input) { }
        public XmlTextReaderNoNS(string url) : base(url) { }
        public override string NamespaceURI { get { return string.Empty; } }
        public override string Prefix { get { return string.Empty; } }
    }
}
